<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
  <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<script type="text/javascript">
  	$(function(){
  		$("#delete").click(function(){
		   	var data=$("#deleteForm :checkbox[name=memo]:checked").serialize();
		    location.href="deleteMemo.do?"+data; 
  		});
  		  		
  	});
  </script>
  
  <input type="button" id="delete" value="삭제">
  
  <form id="deleteForm">
   <table>
  	  <td>/</td><td>보낸사람</td><td>보낸날짜</td><td>제목</td><td>/</td>
  <c:forEach items="${requestScope.memoList}" var="memo">
 	  <tr>
 	  <td><input type="checkbox" name="memo"  value="${memo.no}"></td>
	  <td>${memo.sendMember.id}</td>
	  <td>${memo.mdate}</td>
	  <td><a href="showMemo.do?no=${memo.no}">${memo.title}</a></td>
	  <c:choose>
		  <c:when test="${memo.check==1 }">
		   <td><font color="blue">New</font><td>
		   </c:when>
		   <c:otherwise>
		   <td>읽음<td>
		   </c:otherwise>
	  </c:choose>
	  </tr>
  </c:forEach>
   </table> 
   </form>